
import axios from "axios";
import { BASE_URL } from "../Constant";
const COMMENT_BASE_URL = BASE_URL + '/message-board'



export const getComment = (phoneId:any) => {
    return axios.get(
        COMMENT_BASE_URL + `/list?phoneId=${phoneId}`
    )
}
export const getAllComment = (phoneId:any) => {
    return axios.get(
        COMMENT_BASE_URL + `/listAll?phoneId=${phoneId}`
    )
}

export const submitComment = (data:any) => {
    return axios.post(
        COMMENT_BASE_URL + '/save',
        data
    )
}
export const passApi = (data:any) => {
    return axios.post(
        COMMENT_BASE_URL + '/pass',
        data
    )
}

export const getByUserName = (userName:string) => {
    return axios.get(
        COMMENT_BASE_URL + `/getByUserName?userName=${userName}`
    )
}

export const deleteCommentApi = (id:string) => {
    return axios.delete(
        COMMENT_BASE_URL + '/del',
        {
            data:{
                id
            }
        }
    )
}